package cn.iocoder.yudao.framework.common.util;

import org.apache.commons.lang3.StringUtils;

import java.util.Random;

public class MobileToUtils {

    public static String mobileTo(String mobile) {
        if (StringUtils.isBlank(mobile)) {
            return null;
        }
        int i = Integer.parseInt(mobile.substring(0, 3));
        String[] strs = new String[]{
                "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","S"
        };
        int j = Integer.hashCode(i) /26;
        return strs[j] + mobile.substring(7)+ new Random().nextInt(9) + mobile.substring(3,7);
    }

}
